#ifndef CL_INPUT_H
#define CL_INPUT_H

#include "../common/common.h"
#include "../common/keymap.h"

typedef struct {
	bool	down;
	int		repeats;
	char	* binding;
} keystate_t;

//键盘状态
extern int			anykeydown;
extern keystate_t	keys[MAX_KEYS];

bool	key_is_down(int keynum);
bool	key_str_is_down(const char * str);

int		key_str_to_num(const char * str);
char *	key_num_to_str(int keynum);

void	key_set_binding(int keynum, const char *binding);
char *	key_get_binding(int keynum);
void	key_unbind_all(void);

void	key_clear_states(void);

//鼠标状态
extern int mouse_pos_x;
extern int mouse_pos_y;
extern int mouse_rel_x; //relation 鼠标变化
extern int mouse_rel_y;
extern int mouse_vel_x;
extern int mouse_vel_y;


#endif /* end of include guard: CL_INPUT_H */
